/*
 * @Author: Sam
 * @Date: 2020-11-10 20:50:40
 * @LastEditTime: 2021-12-16 11:13:15
 * @LastEditors: Sam
 * @Description:
 * @FilePath: \resourcesf:\thework\tofba-client\src\api\waybill.js
 * @可以输入预定的版权声明、个性签名、空行等
 */
import request from '@/utils/request'

// 编辑、新增 页面公共数据
// export function initWaybillRender (data) {
//   return request({
//     url: '/seaair/waybills/initWaybillRender',
//     method: 'post',
//     data,
//   })
// }

// 导入 CDA　或者报关资料
export function uploadWaybillFile (data) {
  return request({
    url: '/seaair/waybills/uploadWaybillFile',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
// 保存附件信息
export function saveWaybillFile (data) {
  return request({
    url: '/seaair/waybills/saveWaybillFile',
    method: 'post',
    data
  })
}
// FBA导入箱单发票
export function doImportPackLists (data) {
  return request({
    url: '/seaair/waybills/doImportPackLists',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
// 导入箱单发票
export function doImportLiquidationPacking (data) {
  return request({
    url: '/seaair/waybills/doImportLiquidationPacking',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 查询海空运单状态数据
export function initListPage (data) {
  return request({
    url: '/seaair/waybills/initListPage',
    method: 'post',
    data
  })
}

// 查询海空运单列表
export function listPage (data) {
  return request({
    url: '/seaair/waybills/listPage',
    method: 'post',
    data
  })
}

// 查价
export function queryChannelPrices (data) {
  return request({
    url: '/seaair/waybills/queryChannelPrices',
    method: 'post',
    data
  })
}

// 删除 运单
export function deleteWaybillById (data) {
  return request({
    url: '/seaair/waybills/deleteWaybillById',
    method: 'post',
    params: data
  })
}
// 运单打回待确认
export function replyWaybill (data) {
  return request({
    url: '/seaair/waybills/replyWaybill',
    method: 'post',
    params: data
  })
}
// 查询单个运单
export function getWaybillById (data) {
  return request({
    url: '/seaair/waybills/getWaybillById',
    method: 'post',
    params: data
  })
}
// 根据国家查询出其相关的FBA仓库
export function queryFbaCodeByCoutry (data) {
  return request({
    url: '/seaair/waybills/queryFbaCodeByCoutry',
    method: 'post',
    params: data
  })
}
// 匹配国内分区
export function queryInStockChannel (data) {
  return request({
    url: '/seaair/waybills/queryInStockChannel',
    method: 'post',
    data
  })
}
// 渠道检索,根据条件取得满足条件的渠道
export function queryMatchProvince (data) {
  return request({
    url: '/seaair/waybills/queryMatchProvince',
    method: 'post',
    data
  })
}
// FBA下单保存操作
export function saveWaybillFba (data) {
  return request({
    url: '/seaair/waybills/saveWaybillFba',
    method: 'post',
    data
  })
}
// 标准下单保存操作
export function saveWaybillStandard (data) {
  return request({
    url: '/seaair/waybills/saveWaybillStandard',
    method: 'post',
    data
  })
}

// 上传图片
export function uploadImage (data) {
  return request({
    url: '/seaair/waybills/uploadImage',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 查询预约提货列表
export function pageTakeDeliveryOfGoods (data) {
  return request({
    url: '/seaair/waybills/pageTakeDeliveryOfGoods',
    method: 'post',
    data
  })
}

// 提交预约提货
export function createTakeDeliveryOfGoods (data) {
  return request({
    url: '/seaair/waybills/createTakeDeliveryOfGoods',
    method: 'post',
    data
  })
}
// 删除预约提货
export function deleteTakeDeliveryOfGoods (data) {
  return request({
    url: '/seaair/waybills/deleteTakeDeliveryOfGoods',
    method: 'post',
    data
  })
}
// 取消提货
export function cancleTakeDeliveryOfGoods (data) {
  return request({
    url: '/seaair/waybills/cancleTakeDeliveryOfGoods',
    method: 'post',
    data
  })
}

// 评价预约提货
export function appraisedTakeDeliveryOfGoods (data) {
  return request({
    url: '/seaair/waybills/appraisedTakeDeliveryOfGoods',
    method: 'post',
    data
  })
}

// 批量交寄 param object.waybillIds[]
export function fetchLiquidationInvoiceMeasurementUnit (data) {
  return request({
    url: '/seaair/waybills/fetchLiquidationInvoiceMeasurementUnit',
    method: 'post',
    data
  })
}

// 合并报关 param object.waybillIds[]
export function mergerDeclaration (data) {
  return request({
    url: '/seaair/waybills/mergerDeclaration',
    method: 'post',
    data
  })
}

// 取消合并报关 param object.waybillIds[]
export function cancelMergerDeclaration (data) {
  return request({
    url: '/seaair/waybills/cancelMergerDeclaration',
    method: 'post',
    data
  })
}

// 打印运单标签

// 打印运单标签10X10（pdf）
export function createPdfLabel10x10 (data) {
  return request({
    url: '/seaair/waybills/createPdfLabel10x10',
    method: 'post',
    // params: data,
    data
  })
}
// 打印运单标签10X8（pdf）
export function createPdfLabel10x8 (data) {
  return request({
    url: '/seaair/waybills/createPdfLabel10x8',
    method: 'post',
    data
  })
}
// 打印运单标签A4（pdf）
export function createPdfLabelA4 (data) {
  return request({
    url: '/seaair/waybills/createPdfLabelA4',
    method: 'post',
    data
  })
}
// 打印运单标签（10*10）
export function printWaybillLabel (data) {
  return request({
    url: '/seaair/waybills/printWaybillLabel',
    method: 'post',
    data
  })
}

// 问题件 queryQuestionsByWaybillId

export function queryQuestionsByWaybillId (data) {
  return request({
    url: '/seaair/waybills/queryQuestionsByWaybillId',
    method: 'post',
    data
  })
}
// 初始化 评价

export function initData (data) {
  return request({
    url: '/seaair/waybillce/initData',
    method: 'post'
    // data
  })
}

// 详情
export function chatrecordlist (data) {
  return request({
    url: '/seaair/waybillce/waybilleldetails',
    method: 'post',
    params: data
  })
}
// 保存评价
export function customerevaluationSave (data) {
  return request({
    url: '/seaair/waybillce/save',
    method: 'post',
    data
  })
}
// 追加评价
export function waybillelAddComments (data) {
  return request({
    url: '/seaair/waybillce/waybillelAddComments',
    method: 'post',
    data
  })
}
// 追加评价
export function initWaybillState (data) {
  return request({
    url: '/seaair/waybills/initWaybillState',
    method: 'post',
    params: data
  })
}
// 下载已上传装箱单
export function exportLiquidationPacking (data) {
  return request({
    url: '/seaair/waybills/exportLiquidationPacking',
    method: 'post',
    params: data
  })
}
// 通过运单号检索订单信息
export function searchOrderByWaybillNo (data) {
  return request({
    url: '/seaair/waybills/searchOrderByWaybillNo',
    method: 'post',
    params: data
  })
}
// 通过参考号检索订单信息
export function searchOrderByReferenceNo (data) {
  return request({
    url: '/seaair/waybills/searchOrderByReferenceNo',
    method: 'post',
    params: data
  })
}
// 模糊搜索
export function searchLikeOrderToCustomer (data) {
  return request({
    url: '/seaair/waybills/searchLikeOrderToCustomer',
    method: 'post',
    params: data
  })
}
// 查询附件信息
export function queryWaybillFileList (data) {
  return request({
    url: '/seaair/waybills/queryWaybillFileList',
    method: 'post',
    params: data
  })
}
// 删除附件信息
export function deleteWaybillFile (data) {
  return request({
    url: '/seaair/waybills/deleteWaybillFile',
    method: 'post',
    params: data
  })
}
// 查看入库单
export function querySubWaybill (data) {
  return request({
    url: '/seaair/waybills/querySubWaybill',
    method: 'post',
    params: data
  })
}
// 查看费用信息
export function queryWaybillReceive (data) {
  return request({
    url: '/seaair/waybills/queryWaybillReceive',
    method: 'post',
    data
    // params: data
  })
}
// 客户远程搜索
export function customerReceivables (data) {
  return request({
    url: '/seaair/g2gairseaairwaybills/customerReceivables',
    method: 'post',
    data
  })
}
// 查询收货地址
export function getImporterAndPickupAddr (data) {
  return request({
    url: '/seaair/g2gairseaairwaybills/getImporterAndPickupAddr',
    method: 'post',
    data
  })
}
// 初始化
export function initPageData (data) {
  return request({
    url: '/seaair/g2gairseaairwaybills/initPageData',
    method: 'post'
  })
}
// 新增客户收货地址
export function saveCustomerPickupAddress (data) {
  return request({
    url: '/seaair/g2gairseaairwaybills/saveCustomerPickupAddress',
    method: 'post',
    data
  })
}
// 保存
export function saveG2GAirWaybill (data) {
  return request({
    url: '/seaair/g2gairseaairwaybills/saveG2GAirWaybill',
    method: 'post',
    data
  })
}
// 进口商信息
export function queryCustomerImporter (data) {
  return request({
    url: '/seaair/waybills/queryCustomerImporter ',
    method: 'post',
    data
  })
}
// 下载文件
export function downloadFile (data) {
  return request({
    url: '/seaair/waybills/downloadFile',
    method: 'post',
    responseType: 'blob',
    params: data
  })
}
// 计费重 体积等字段
export function getPackingList (data) {
  return request({
    url: '/seaair/waybills/getPackingList',
    method: 'post',
    params: data
  })
}
// 一键中转下单（至海外仓）
export function transferCreateAboradWaybill (data) {
  return request({
    url: '/seaair/waybills/transferCreateAboradWaybill',
    method: 'post',
    params: data
  })
}
// 取消一键中转下单（至海外仓）
export function cancelTransferAboradWaybill (data) {
  return request({
    url: '/seaair/waybills/cancelTransferAboradWaybill',
    method: 'post',
    params: data
  })
}

// 发票SKU查询
export function queryApiSkuInfos (data) {
  return request({
    url: '/customer/skuInfos/queryApiSkuInfos',
    method: 'post',
    data
  })
}

// 发票SKU查询
export function downLoadWarehouse (data) {
  return request({
    url: '/seaair/waybills/downLoadWarehouse',
    method: 'post',
    params: data
  })
}

